package chenji.gunapi.gun;

import org.bukkit.Location;

public class SoundHandler {
	private String reloadsound;
	private String reload2Sound;
	private String ShootSound;

	public enum SoundType {
		RELOAD, RELOAD2, SHOOT;
	}

	public SoundHandler(String reloadsound, String reload2Sound, String ShootSound) {
		this.reload2Sound = reload2Sound;
		this.reloadsound = reloadsound;
		this.ShootSound = ShootSound;
	}

	public void playSound(SoundType type, Location l) {
	
		String sound = null;
		System.out.println(type);
		switch (type) {
		case RELOAD:
			sound = this.reloadsound;
			break;
		case RELOAD2:
			sound = this.reload2Sound;break;
		case SHOOT:
			sound = this.ShootSound;break;
		}System.out.println(sound);
		if (sound == null) {
			return;
		}
		
		l.getWorld().playSound(l, sound, 1.0F, 1.0F);
	}
}
